var a = getApp();

Page({
    data: {
        ad: {},
        appset: {},
        wxminiset: [
            {logo:'/image/other/canvas.jpg',name:'canvas绘图',appid:'wx440d39dfd9bfb593'},
            {logo:'/image/other/qushuiyin.jpg',name:'短视频去水印工具包',appid:'wxc27ec0ba017acaa3'},
            {logo:'/image/other/daka.jpg',name:'打卡领好礼',appid:'wx97528088ec555c27'},
            {logo:'/image/other/bizhi.jpg',name:'精美手机bz下载',appid:'wx00ccd87ad507db32'}
        ],
        extraData: {
            id: "172750"
        }
    },
    onShow(){
        this.getRandomAd()
        getApp().chaping()
    },
    onLoad: function(e) {
        getApp().getRandomAd(true,this)
        this.getRandomAd(true)
    },
    getCode: function() {
        wx.showToast({
            title: "长按保存图片",
            icon: "none"
        }), setTimeout(function() {
            wx.previewImage({
                urls: [ "/image/wxcode.png" ]
            });
        }, 200);
    },
    copyurl: function(a) {
        wx.setClipboardData({
            data: a.currentTarget.dataset.url,
            success: function(a) {
                wx.showToast({
                    title: "下载地址复制成功",
                    icon: "none"
                });
            }
        });
    },
    copyname: function(a) {
        wx.setClipboardData({
            data: a.currentTarget.dataset.name,
            success: function(a) {
                wx.showToast({
                    title: "APP名称复制成功",
                    icon: "none"
                });
            }
        });
    },
    goToTxc: function() {
        wx.navigateToMiniProgram({
            appId: "wx8abaf00ee8c3202e",
            extraData: this.data.extraData
        });
    },
    updatelog: function() {
        wx.navigateTo({
            url: "/pages/log/log"
        });
    },
    onReady: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            title: "超好用的图片编辑小程序",
            path: "pages/index/index",
            imageUrl: "/image/maskshareimg.png"
        };
    },
    openzp: function() {
        wx.navigateToMiniProgram({
            appId: "wxc970e4d6577e7e90",
            path: "pages/index/index",
            envVersion: "release",
            success: function(a) {}
        });
    },
    openbq: function() {
        wx.navigateToMiniProgram({
            appId: "wxb95c179e268861ca",
            path: "pages/emotionEdit/emotionEdit",
            envVersion: "release",
            success: function(a) {}
        });
    }
});